package AdapterPattern;

/**
 * 
 */
public class DataOperationAdapter implements DataOperation {

    /**
     * Default constructor
     */

    public DataOperationAdapter(QuickSort sortObj, BinarySearch searchObj) {
        this.sortObj = sortObj;
        this.searchObj = searchObj;
    }

    /**
     * 
     */
    private QuickSort sortObj;

    /**
     * 
     */
    private BinarySearch searchObj;

    /**
     * @param array
     */
    public void sort(Integer[] array) {
        // TODO implement here
        sortObj.quickSort(array);
    }

    /**
     * @param array 
     * @param searchData 
     * @return
     */
    public int search(Integer[] array, int searchData) {
        // TODO implement here
        return searchObj.binarySearch(array, searchData);
    }
}